﻿using System;
using LERP.Domain.Enums;

namespace LERP.Domain
{
    using SharpArch.Domain.DomainModel;
    using System.ComponentModel.DataAnnotations;

    /// <summary>
    /// 员工
    /// </summary>
    public class User : Entity
    {
        /// <summary>
        /// 登录名  登录名唯一
        /// </summary> 

        [Display(Name = "登录名")]
        [Required(ErrorMessage = "{0}不能为空")]
        [StringLength(32, ErrorMessage = "{0}取值长度{1}~{2}个字符", MinimumLength = 0)]
        public virtual string UserName{get;set;}
        /// <summary>
        /// 姓名
        /// </summary>
        [Display(Name = "姓名")]
        [Required(ErrorMessage = "{0}不能为空")]
        [StringLength(32, ErrorMessage = "{0}取值长度{1}~{2}个字符", MinimumLength = 0)]
        public virtual string Name{get;set;}
        /// <summary>
        /// 密码
        /// </summary>
        [Display(Name = "密码")]
        [Required(ErrorMessage = "{0}不能为空")]
        [StringLength(225, ErrorMessage = "{0}取值长度{1}~{2}个字符", MinimumLength = 0)]
        public virtual string Password{get;set;}
        /// <summary>
        /// 手机号码
        /// </summary>
        [Display(Name = "手机号码")]
        [Required(ErrorMessage = "{0}不能为空")]
        [StringLength(32, ErrorMessage = "{0}取值长度{1}~{2}个字符", MinimumLength = 0)]
        public virtual string Mobile { get; set; }
        /// <summary>
        /// 邮箱
        /// </summary>
        [Display(Name = "邮箱")]
        [Required(ErrorMessage = "{0}不能为空")]
        [StringLength(32, ErrorMessage = "{0}取值长度{1}~{2}个字符", MinimumLength = 0)]
        public virtual string Email { get; set; }
        /// <summary>
        /// 员工角色
        /// </summary>
        [Display(Name = "员工角色")]
        [Required(ErrorMessage = "{0}不能为空")]
        public virtual UserRole Role { get; set; }
        /// <summary>
        /// 员工状态
        /// </summary>
        [Display(Name = "员工状态")]
        [Required(ErrorMessage = "{0}不能为空")]
        public virtual DataStatus Stauts { get; set; }
        /// <summary>
        /// 权限
        /// </summary>
        [Display(Name = "权限")]
        [Required(ErrorMessage = "{0}不能为空")]
        public virtual int Functions { get; set; }

        /// <summary>
        /// 创建时间
        /// </summary>
        [Required(ErrorMessage = "{0}不能为空")]
        public virtual DateTime Created { get; set; }
        /// <summary>
        /// 修改时间
        /// </summary>
        [Required(ErrorMessage = "{0}不能为空")]
        public virtual DateTime Modified { get; set; }
 
    }
}